package cn.wolfcode.rbac.mapper;

import cn.wolfcode.rbac.domain.Employee;
import cn.wolfcode.rbac.domain.query.EmployeeQueryObject;
import cn.wolfcode.rbac.domain.vo.AdminStateVo;
import cn.wolfcode.rbac.domain.vo.LoginInfoVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper extends BaseMapper<Employee> {
    //根据id查询员工信息
    Employee selectById(Long id);
    //查询所有员工
    List<Employee> selectAll();
    //根据员工id删除员工
    int deleteById(Long id);
    //添加员工
    int insert(Employee employee);
    //根据员工id更新员工
    int updateById(Employee employee);
    // 查询分页数据
    List<Employee> queryForList(EmployeeQueryObject qo);
    // 更新员工管理员状态
    int updateStateById(AdminStateVo adminStateVo);
    // 维护员工角色关系
    int deleteEmployeeRoleRelationByEmpId(@Param("empId") Long empId);
    // 维护员工角色关系
    int insertEmployeeRoleRelation(@Param("empId") Long empId,@Param("roleId") Long id);
    int batchInsertEmployeeRoleRelation(@Param("empId") Long empId,@Param("roleIds") List<Long> roleIds);

    Employee login(LoginInfoVo loginInfoVo);

    // 通过姓名查询员工信息
    Employee selectByName(@Param("username") String username);
}
